﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
/// <summary>
/// Summary description for UserAccountDto
/// </summary>
public class UserAccountDto
{
    #region "variable"
    private int id_UA;    
    private int id_UD;    
    private string _userName;    
    private string _password;    
    private string _name;    
    private string _dateOfBirth;    
    private bool _sex;    
    private string _email;    
    private string _adress;    
    #endregion

    #region "properties"
    public int Id_UA
    {
        get { return id_UA; }
        set { id_UA = value; }
    }
    public int Id_UD
    {
        get { return id_UD; }
        set { id_UD = value; }
    }
    public string UserName
    {
        get { return _userName; }
        set { _userName = value; }
    }
    public string Password
    {
        get { return _password; }
        set { _password = value; }
    }
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }
    public string DateOfBirth
    {
        get { return _dateOfBirth; }
        set { _dateOfBirth = value; }
    }
    public bool Sex
    {
        get { return _sex; }
        set { _sex = value; }
    }
    public string Email
    {
        get { return _email; }
        set { _email = value; }
    }
    public string Adress
    {
        get { return _adress; }
        set { _adress = value; }
    }
    #endregion

    public UserAccountDto()
	{
		
	}
    public UserAccountDto(DataRow row)
    {
        this.id_UA=(int)row["id_UA"];
        this.id_UD = (int)row["id_UD"];
        if (row["_adress"]==DBNull.Value)
        {
            this._adress = "";
        }
        else this._adress=(string)row["_adress"];
        if (row["_dateOfBirth"]==DBNull.Value)
        {
            this._dateOfBirth = "";
        }
        else this._dateOfBirth=DateTime.Parse(row["_dateOfBirth"].ToString()).ToString("dd/MM/yyyy");
        if (row["_email"]==DBNull.Value)
        {
            this._email = "";
        }
        else this._email=(string)row["_email"];
        this._name=(string)row["_name"];
        this._password=(string)row["_password"];
        this._sex = bool.Parse(row["_sex"].ToString());
        this._userName=(string)row["_userName"];
    }
    public UserAccountDto(int id_UA,string _fullName,string _birthday,bool _sex,string _email,string _adress)
    {
        this.id_UA = id_UA;
        this._adress = _adress;
        this._dateOfBirth = _birthday;
        this._email = _email;
        this._name = _fullName;
        this._sex = _sex;
    }
}